package partition;

import java.util.Random;

/**
 * Created by hps on 17-5-1.
 */
public class PartitionApp {
    public static void main(String[] args) {
        int maxSize = 16;
        ArrayPar arr = new ArrayPar(maxSize);
        Random random = new Random(System.currentTimeMillis());

        for (int i = 0; i < maxSize; i++) {
            arr.insert(random.nextInt(200));
        }
        arr.display();

        long pivot = 99;
        System.out.print("Pivot is " + pivot);
        int parDex = arr.partitionIt(0, maxSize- 1, pivot);
        System.out.println(", Partition is at index " + parDex);
        arr.display();
    }
}
